<%@ page language="java" contentType="text/html;charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>权限列表页面</title>
<style>
	.title {
		font-size:15px;
		margin-top:15px;
	}
	
	.content {
		font-size:13px;
		display:none;
	}
</style>
</head>
<body>
	<div>
		<c:forEach items="${loginUser.powerList}" var="item" >
			<c:if test="${item.iType == 1}">
				<c:if test="${item.iModelId != lastModel}">
					<c:if test="${not empty lastModel }">
						</div>
					</c:if>
					<div class="title">		
						${item.sModelName}
					</div>
					<div class="content">
					<c:set var="lastModel" value="${item.iModelId }" scope="page"/>
				</c:if>
				<div>
					<a href="${item.sUrl}" target="right">${item.sName}</a>
				</div>
			</c:if>
		</c:forEach>
		<c:if test="${not empty lastModel} ">
			</div>
		</c:if>
		</div>
	</div>
</body>
<script type="text/javascript" src="js/jquery-3.2.1.js"></script>
<script type="text/javascript">
	$(".title").click(function() {
		var index = $(this).index(".title");
		$(".content").each(function(i) {
			if (i != index) {
				$(this).hide();
			} else {
				$(this).show();
			}
		});
	});
</script>
</html>